package LogCorrelation;

/**
 * RawLog is a class to hold raw log data along with a hash of the 
 * original raw log.
 * @author Craig Campbell
 */
public class RawLog {
    
    /**
     * The raw log entry.
     */
    String rawLogEntry;
    
    /**
     * The one-way hash of the original raw log entry.
     */
    byte[] rawLogHash;
    
    public RawLog() {
        // TODO: Add logic.
    }
    
    /**
     * Creates a new RawLog object given a raw log string.  A hash of the 
     * raw log is created automatically.
     * @param log 
     */
    public RawLog(String log) {
        rawLogEntry = log;
        createHash();
    }
    
    /**
     * Returns the log entry that this RawLog was initiated with.
     * 
     * @return The original raw log entry.
     */
    public String getLog() {
        return rawLogEntry;
    }
    
    /**
     * Returns the hash of the original raw log entry.  This can be used to 
     * verify that the log has not been changed.
     * 
     * @return The hash of the original raw log entry.
     */
    public byte[] getHash() {
        return rawLogHash;
    }
    
    /**
     * Creates the hash of the original raw log entry.
     */
    private void createHash() {
        // TODO: Add logic to create a MD5 hash of the raw log entry.
    }
}
